import com.cipri.battle.events.GameEvent;

private function init():void 
{
	battle.addEventListener(GameEvent.GAME_OVER, onGameOver);
    battle.addEventListener(GameEvent.MISSED_HIT, onMissedHit);
    battle.addEventListener(GameEvent.SHAPE_DOWN, onShapeDown);
    battle.addEventListener(GameEvent.SUCCESSFUL_HIT, onSuccessfulHit);
}

private function onSuccessfulHit(e:GameEvent):void 
{
    txt.text += "\nSuccessful hit";
}

private function onShapeDown(event:GameEvent):void 
{
    txt.text += "\nShape number " + event.shapeId + " is down";
}

private function onMissedHit(event:GameEvent):void 
{
	txt.text += "\nMissed hit";    
}

private function onGameOver(event:GameEvent):void 
{
 	txt.text += "\nGAME OVER";
}

private function onGenerate(event:MouseEvent):void 
{
		
}